﻿Imports JuegosLanBackend
Public Class Buscar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim juego As String = Me.TxtBuscar.Text

        Dim negocio As New JuegoNegocio
        Dim juegos As Collection = negocio.buscarPorNombre(juego)
        Me.Muestra.DataSource = juegos
        Me.Muestra.EditMode = False
        Me.Muestra.Columns(0).HeaderText = "ID"
        Me.Muestra.Columns(1).HeaderText = "Nombre"
        Me.Muestra.Columns(2).HeaderText = "Version"
        Me.Muestra.Columns(3).HeaderText = "Fabricante"

    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim seleccionado = Me.Muestra.CurrentRow.Cells(0).Value.ToString
        Dim negocio As New JuegoNegocio
        negocio.eliminar(seleccionado)
        Muestra.DataSource = ""
    End Sub
End Class